package com.seetools.generator.config;

import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.converts.MySqlTypeConvert;
import com.baomidou.mybatisplus.generator.config.querys.MySqlQuery;

/**
 * @Author: seeTools
 * @Date: 2023/5/18  16:45
 * @Version 1.0
 */
public class SqlInitConfig {

    /**
     * jdbc连接
     */
    private static final String URL = "jdbc:mysql://localhost:3306/next-dev?serverTimezone=GMT%2B8&useSSL=false&useUnicode=true&characterEncoding=utf8";
    private static final String DRIVER = "com.mysql.cj.jdbc.Driver";
    /**
     * 账号
     */
    private static final String USE = "root";

    /**
     * 密码
     */
    private static final String PWD = "zfy123456";

    /**
     * 数据库配置
     */
    public static DataSourceConfig sqlInit() {
        DataSourceConfig config = new DataSourceConfig();
        config.setDbQuery(new MySqlQuery());
        config.setTypeConvert(new MySqlTypeConvert());
        config.setUrl(URL);
        config.setPassword(PWD);
        config.setUsername(USE);
        config.setDriverName(DRIVER);
        return config;
    }

}
